-
Notifications
You must be signed in to change notification settings - Fork 673
Implement exif_metadata for TIFF
#2613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Exif metadata for TIFF is funny, as the Tiff file itself is stored in the exif directory structure. So the trivial answer to what is Exif metadata is just the bytes of the file itself... Co-authored-by: Rasmus Piorr <[email protected]>
|
I'm not a fan of this approach because if the application handles Exif like a black box and forwards it to the output (like most image conversion programs would do, including my own |
Thanks for the feedback, that makes sense! I think the alternative for sure results in less pixel data, but is also annoying for the image crate:
This will result in smaller exif blocks for sure, but currently has the problem that we cannot really write exif blocks easily in Rust. The only thing I found is the experimental Writer in kamadak-exif: https://docs.rs/kamadak-exif/0.6.1/exif/experimental/struct.Writer.html. |
|
Writing exif is the same as writing We have a choice here:
I tend towards (2). Currently, in |
|
Yeah I agree and thanks for the summary @197g! Then let me take a stab at (2). Would it be fine to add a dependency on kamadak-exif and its experimental |
|
Definitely for sketch purposes and it is lightweight enough. The unsafe dependency needs some muster, I wonder what it is for. But should not hold up the implementation in principle as it does not leak immediately to the API as far as I can tell. |
Exif metadata for TIFF is funny, as the Tiff file itself is stored in the exif directory structure. So the trivial answer to what is Exif metadata is just the bytes of the file itself.
Note: This is not the most efficient way of obtaining the metadata as it also copies the image bytes, which we technically don't need. The alternative here is to add this to the tiff create and copy the correct metadata sections together. We didn't pursue this route as there were ideas to rework the entire
tiff::Valuetype and this would likely add a huge dependency on the current behavior. We're open for feedback if we should to go down that route, though.